import request from '@/utils/request';

export function fetchDoctorList(deptId) {
    return request({
        url: '/doc/listByDeptId',
        method: 'get',
        params: {
            deptId: deptId
        }
    });
}

export function fetchUser(token) {
    return request({
        url: '/doc/getUser',
        method: 'post',
        params: {
            token: token
        }
    });
}

export function fetchDocList(docName, page, limit) {
    return request({
        url: '/doc/list',
        method: 'get',
        params: {
            docName: docName,
            page: page,
            limit: limit
        }
    });
}

export function addDoc(doc) {
    return request({
        url: '/doc/add',
        method: 'post',
        data: doc
    });
}

export function renewDoc(doc) {
    return request({
        url: '/doc/renew',
        method: 'post',
        data: doc
    });
}

export function removeDoc(docId) {
    return request({
        url: '/doc/remove',
        method: 'post',
        params: {
            docId: docId
        }
    });
}
